public class PlayerAIState_AcceptBaseLineBall : State<PlayerAI>
{
	public static PlayerAIState_AcceptBaseLineBall instance;

	private PlayerAIState_AcceptBaseLineBall()
	{
	}

	public static PlayerAIState_AcceptBaseLineBall getInstance()
	{
		if (instance == null)
		{
			instance = new PlayerAIState_AcceptBaseLineBall();
		}
		return instance;
	}

	public override void enter(PlayerAI owner)
	{
		base.enter(owner);
		//if (!GameData.IsFinishTutorial && owner.player.teamType == TeamType.COMPUTER && TutorialController.preTutorialType != TutorialType.Game_RealGame)
		//{
		//	while (MathHelper.getSqrDistance(owner.player.acceptbasslineball_targetPos, owner.player.getParaTeam().getPlayer_ControlBall().getPosition()) < 2f)
		//	{
		//		owner.player.acceptbasslineball_targetPos = owner.player.team.getAccetpBaseLineBallPos(Global.posBaseLineRight);
		//	}
		//}
	}

	public override void fixedUpdate(PlayerAI owner)
	{
		base.fixedUpdate(owner);
		if (owner.player.isInState(PlayerStateBehavior_CatchBall.getInstance()))
		{
			return;
		}
		if (MathHelper.getSqrDistance(owner.player.getPosition(), owner.player.acceptbasslineball_targetPos) < 4f)
		{
			if (GameHelper.MoveTo(owner.player, owner.player.acceptbasslineball_targetPos, owner.player.getMoveSpeed(), isLookAtTargetPos: false))
			{
				owner.player.do_idle();
				owner.player.LookAtSmooth(MathHelper.setOffestY(Instance<Ball>.instance.getPosition(), 0f));
			}
			else
			{
				owner.player.do_run();
			}
			owner.player.LookAtSmooth(MathHelper.setOffestY(Instance<Ball>.instance.getPosition(), 0f));
		}
		else if (GameHelper.MoveTo(owner.player, owner.player.acceptbasslineball_targetPos, owner.player.getMoveSpeed(), isLookAtTargetPos: true))
		{
			owner.player.do_idle();
			owner.player.LookAtSmooth(MathHelper.setOffestY(Instance<Ball>.instance.getPosition(), 0f));
		}
		else
		{
			owner.player.do_run();
		}
	}
}
